﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;

public partial class PublishActivity_ActivityQuery : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DbHelperMySQL.Query("select * from bas_class");
        TemplateField customField = new TemplateField();
        customField.ShowHeader = true;

        customField.HeaderTemplate = new GridViewTemplate(DataControlRowType.Header, "选择");
        //customField.HeaderStyle = ;
        customField.ItemTemplate = new GridViewTemplate(DataControlRowType.DataRow, "");


        gvActivityList.Columns.Add(customField);
        gvActivityList.DataSource = CreateDataSource();
        gvActivityList.DataBind();
    }



    ICollection CreateDataSource()
    {

        DataTable dt = new DataTable();

        DataRow dr;

        dt.Columns.Add(new DataColumn("序号", typeof(Int32)));

        dt.Columns.Add(new DataColumn("填写日期", typeof(string)));

        dt.Columns.Add(new DataColumn("发布日期", typeof(string)));

        dt.Columns.Add(new DataColumn("活动标题", typeof(string)));

        dt.Columns.Add(new DataColumn("投稿有效日期", typeof(string)));

        dt.Columns.Add(new DataColumn("投稿数量", typeof(Int32)));

        dt.Columns.Add(new DataColumn("未投稿人数", typeof(string)));

        dt.Columns.Add(new DataColumn("发布状态", typeof(string)));

        dt.Columns.Add(new DataColumn("投稿总结", typeof(string)));




        //for (int i = 0; i < 6; i++)
        //{

        //    dr = dt.NewRow();

        //    dr[0] = i;

        //    dr[1] = "<a>列表项目</a>" + i.ToString();
        //    dt.Rows.Add(dr);
        //}
        DataView dv = new DataView(dt);
        return dv;

    }
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        string startDate = this.startDate.Text.Trim() ;
        string endDate = this.endDate.Text.Trim();
        string activityTitle = this.activityTitle.Text.Trim();
        int publishStatus = Convert.ToInt32(this.ddlStatus.SelectedValue.Trim());
    }
}